<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>TZ-追梦</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
<input type="button" value="按钮" id="btn">
    <script>
        btn.onclick = function () {
            var w = new Worker('worker1.js');
            w.postMessage('逐梦');

            w.onmessage = function (e) {
                console.log( e.data );
            };
        };
    </script>
</body>
</html>